package api

import (
    "github.com/gin-gonic/gin"
    "yi-shou-backstage/errmsg"
    "yi-shou-backstage/module"
)

// 上传图片素材
func UploadUserImageApi(ctx *gin.Context) {
    code, msg, data := module.UploadUserImageControl(ctx)
    if code != errmsg.SUCCESS {
        Failed(ctx, code, msg, data)
        return
    }
    Success(ctx, code, msg, data)
}

// 收藏图片素材
func PutUserImageApi(ctx *gin.Context) {
    code, msg, data := module.PutUserImageControl(ctx)
    if code != errmsg.SUCCESS {
        Failed(ctx, code, msg, data)
        return
    }
    Success(ctx, code, msg, data)
}

// 获取图片列表
func GetUserImagesApi(ctx *gin.Context) {
    code, msg, data := module.GetUserImagesControl(ctx)
    if code != errmsg.SUCCESS {
        Failed(ctx, code, msg, data)
        return
    }
    Success(ctx, code, msg, data)
}

// 删除图片素材
func DeleteUserImageApi(ctx *gin.Context) {
    code, msg, data := module.DeleteUserImageControl(ctx)
    if code != errmsg.SUCCESS {
        Failed(ctx, code, msg, data)
        return
    }
    Success(ctx, code, msg, data)
}